<!doctype html>
<html lang="en" style="height:100%;">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title></title>
    {block name="loadCss"}

    {/block}
    {block name="style"}
    {/block}
    <link rel="stylesheet" href="__COMMON__css/common.css">
    <link rel="stylesheet" href="__LAYUI__css/layui.css">
    <script type="application/javascript" src="__JQUERY__jquery.min.js"></script>
    <script type="application/javascript" src="__LAYUI__layui.js"></script>
    <style>
        .j-block-body{
            background-color: #eeeeee;
            min-height:92%;
            overflow: auto;
            margin-bottom:5px;
        }
        .j-block-body .layui-card{
            margin-bottom: 0px!important;
            margin:10px 10px 0 10px;
        }
        .j-body{
            height:100%;
            margin:5px;
        }

    </style>
</head>
<body class="j-block-body">
<div class="layui-card layui-card-breadcrumb">
    <div class="layui-card-header">{tag:currentmenu /}</div>
</div>
<div class="layui-card j-body">
    <div class="layui-card-body">
        {block name="content"}

        {/block}
    </div>
</div>

</body>
<script type="application/javascript" src="__COMMON__js/common.js"></script>
<script type="application/javascript" src="__COMMON__js/popups.js"></script>
<script type="application/javascript" src="__EXTRA__ueditor/editor_config.js"></script>
<script type="application/javascript" src="__EXTRA__ueditor/editor_all.js"></script>
<script type="application/javascript" src="__EXTRA__mditor/src/mditor.js"></script>

{block name="loadJs"}

{/block}
{block name="script"}

{/block}
<script>
    layui.use(['element','jquery'], function(){
        var element = layui.element,
            $ = layui.jquery;


        /**
         * 批量删除
         */
        $(document).on('click','#btnDeleteChecked',function(){
            let ids = [];
            $.each(layui.table.checkStatus('table').data,function(index,item){
                ids.push(item.id);
            })
            if(ids.length <=0){
                showpopup('请选择要删除的元素');
                return false;
            }
            let url = '';
            url = $(this).attr('j-href')?'delete':$(this).attr('j-href');
            $.post(url,{ids:ids},function(r){
                if(r.code == 1){
                    showpopup(r.msg,true);
                }else{
                    showpopup(r.msg);
                }
            },'json');
        })

//数据表格搜索
        $(document).on('click','#btnSearch',function(){
            var keywords = $('#edtSearch').val(),
                url = window.location.href;
            var tableIns = layui.table.reload('table',{
                url: url //设置异步接口
                ,where:{
                    keyword:keywords
                }
                ,method:'post'
            });
        })

//数据表格清除搜索
        $(document).on('click','#btnClearSearch',function(){
            var tableIns = layui.table.reload('table',{
                url: window.location.href //设置异步接口
                ,method:'post'
            });
            $('#edtSearch').val('');
        })

    });
</script>
</html>